package com.gator.desig_mode.singleton;

/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class Car {

 /* public static void main(String[] args) {
    Run run = new Run();
    run.setCar(new Posche());
    run.run();


  }*/

  public static void main(String[] args) {

  }

}


abstract class C {

  int a = 10;

  public abstract void a();

  public void b(){
    System.out.println("我是抽象方法里的a");
  }
}

class D extends C{


  @Override
  public void a() {
    System.out.println("我是D");
  }
}

//----------------------------------


class A {

  int a = 10;

  public void a() {
    System.out.println("我是A");
  }

}

class B extends A {


  @Override
  public void a() {
    System.out.println("我是B");
  }

  public void b() {
    System.out.println("我是A中b方法");
  }
}


//运行接口
interface Running {


  void run();
}

class Run implements Running {

  private Start start;

  public void setCar(Start start) {
    this.start = start;
  }

  @Override
  public void run() {
    start.start();
  }
}

//-----------------------------------------------------------------
//启动接口
interface Start {

  void start();
}

class Linghangyuan implements Start {

  @Override
  public void start() {
    System.out.println("领航员启动并运行");
  }
}

class Posche implements Start {

  @Override
  public void start() {
    System.out.println("保时捷启动并运行");
  }
}

//Run 是统一出口，运行不同对象的方法，但他不关心具体运行的实例，只关心抽象Start,  这里使用set进行对应实例的赋值

